home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 4
/
Aminet 4 - November 1994.iso
/
aminet
/
comm
/
cnet
/
lands051c.lha
/
BLmaint
< prev
Wrap
Text File
|
1980-12-14
|
2KB
|
124 lines
/* Battle Lands Maintenance */
options results
path='pfiles:battlelands/users/'
signal on syntax
transmit 'cfRunning Battle Lands Maintenance!'
transmit ''
transmit ''
call open(2,path||'battlers','r')
bll:
battle=readln(2)
name=readln(2);name2=left(name' ',20)
sendstring 'Working on 'name2' '
if eof(2)=1 then signal finished
call loadstats
sendstring 'PFIGHT '
stat.65=0
sendstring 'TURN '
stat.67=0
sendstring 'VISITS '
stat.101=0
sendstring 'GAMBLING '
stat.108=0
call savestats
signal bll
loadstats:
call open(1,path||'stats/'name)
do i=1 to 110
stat.i=readln(1)
end
call close(1)
return
finished:
call close(2)
signal bank
finished2:
transmit 'c9COMPLETE!!'
exit
savestats:
call open(1,path'stats/'||name,'w')
do i=1 to 110
call writeln(1,stat.i)
end
call close(1)
return
bank:
call open(2,path||'banklist','r')
signal ban
ban:
name=readln(2);name2=left(name' ',20)
sendstring 'Working on 'name' '
if eof(2)=1 then signal finished3
call loadaccounts
sendstring 'ACCOUNTS '
if account1<100000 then account1=VRnd(100000,500000)*50
if account1>99999 then account1=account1
call saveaccounts
signal ban
loadaccounts:
call open(1,path||'bank/'name)
user=readln(1)
account1=readln(1)
call close(1)
return
saveaccounts:
call open(1,path'bank/'||name,'w')
call writeln(1,user)
call writeln(1,account1)
call close(1)
return
finished:
call close(2)
signal finished2
finished2:
transmit 'c9COMPLETE!!'
exit
VRnd: procedure /* Very Random v1.1 [c] 1990 Shane D. Killian */
arg lo,hi /* Feel free to use this as long as these */
n1 = time('E') /* comments remain intact. Works like random(). */
n2 = time('S')
parse var n1 n11 '.' n12
n1 = n11 || n12
if lo > hi then do
x = lo
lo = hi
hi = x
end
if hi ~= lo then do
d = hi - lo + 1
x = length(d)
n1 = right(n1,x)
n2 = right(n2,x)
p = d
if p > 999 then p = 999
r = n1 + n2 + random(0,p)
r = r // d + lo
end
else r = hi
return r
error:
syntax:
call close(1)
call close(2)
call close(3)
transmit 'c7Error at line 'sigl' in Battle Lands'
transmit sourceline(sigl)
exit
finished3:
call close(2)
signal finished2